/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       material_pile.h

	$Header: /game/material_pile.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef MATERIAL_PILE_H_INCLUDED
#define MATERIAL_PILE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "material_amount.h"
#include "stationary_adventure_object.h"

// ---------------------------------------------------------------
// a freestanding lump of material
// ---------------------------------------------------------------
class t_material_pile : public t_stationary_adventure_object
{
public:
	t_material_pile( t_material type );
	t_material_pile( t_stationary_adventure_object const& source );

	virtual void				activate_trigger( t_army* army, t_adv_map_point const& point, 
		                                   t_direction direction, t_adventure_frame* frame );
	virtual float				ai_value( t_adventure_ai const& ai, t_creature_array const& army, int move_cost ) const;	
	int							get_amount() const;
	t_material					get_material() const;
	t_material_amount const&	get_material_amount() const;
	virtual bool				read( std::streambuf&						stream, 
									   t_qualified_adv_object_type const&	type,
								      int									version );
	virtual void				right_click( t_mouse_event const& event,
		                                             t_adventure_frame* adventure_frame );
	virtual bool				write( std::streambuf& stream ) const;	
protected:

	t_material_amount m_amount;
};

inline t_material t_material_pile::get_material() const
{
	return m_amount.material;
}

inline int t_material_pile::get_amount() const
{
	return m_amount.amount;
}

inline t_material_amount const& t_material_pile::get_material_amount() const
{
	return m_amount;
}

// ---------------------------------------------------------------
// a random freestanding lump of material
// ---------------------------------------------------------------
class t_random_material_pile : public t_stationary_adventure_object
{
public:
	t_random_material_pile( std::string const& source );
	virtual void		 place( t_adventure_map& map, t_adv_map_point const& point );
protected:
};

#endif // MATERIAL_PILE_H_INCLUDED
